varying vec4 diffuse,ambient;
varying vec3 normal, viewerVec;
varying vec4 shadowTexCoord;

void main()
{	

	normal = normalize(gl_NormalMatrix * gl_Normal);
	
	//gl_TextureMatrix[2] = 
	
	//shadowTexCoord =  (gl_TextureMatrix[0] * gl_ModelViewMatrix) * gl_Vertex;
	//shadowTexCoord =  gl_TextureMatrix[0] * (gl_ModelViewMatrix * gl_Vertex);
	shadowTexCoord =  gl_TextureMatrix[0] * gl_Vertex;
		
	diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
	ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
	ambient += gl_LightModel.ambient * gl_FrontMaterial.ambient;

	viewerVec = -vec3((gl_ModelViewMatrix * gl_Vertex));

	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
} 